from celery import Celery
import os
from django.conf import settings

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'shopmall.settings')

# 创建celery实例
app = Celery('my_celery')


# 指定celery消息队列的配置
app.config_from_object('celery_tasks.config')


# 从所有的django-app中加载任务
app.autodiscover_tasks(settings.INSTALLED_APPS)

